<%--
  Created by IntelliJ IDEA.
  User: 花花
  Date: 2021/6/27
  Time: 23:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path=request.getContextPath();
%>
<html>
<head>
    <meta charset="UTF-8">
    <title>删除用户</title>
</head>
<body style="margin: 0;
    padding: 0;
    background-image: url(index.jpg);
background-repeat: no-repeat;">
<div id="bigbox" style="margin: 0 auto;margin-top: 250px;
padding: 20px 50px;background-color: #00000090;
width: 400px;height: 300px;border-radius: 10px;text-align: center;">
    <h1 style="color: white">删除用户</h1>
    <form action="<%=path%>/delete" method="post" id="deleteForm" style="margin-top: 30px;">
        <input style="margin-top: 20px;border: 0;padding: 10px 10px;border-bottom:1px solid white;background-color:#00000000;color:white;"
               placeholder="用户名" type="text" name="uname" id="uname" value="${messageModel.object.userName}"> <br>
        <input style="margin-top: 20px;border: 0;padding: 10px 10px;border-bottom:1px solid white;background-color:#00000000;color:white;"
               placeholder="密码" type="password" name="upwd" id="upwd"> <br>
        <span id="deletemsg" style="font-size: 12px;color: red">${messageModel.msg}</span><br>
        <button style="border:0;width:75px;height:25px;color:white;border-radius: 20px;
        background-image: linear-gradient(to right, #b8cbb8 0%, #b8cbb8 0%, #b465da 0%, #cf6cc9 33%, #ee609c 66%, #ee609c 100%);"
                type="button" id="deleteBtn">立即删除</button>
    </form>
</div>
</body>
<<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
<script type="text/javascript">
    $("#deleteBtn").click(function (){
        var uname = $("#uname").val();
        var upwd = $("#upwd").val();
        if(isEmpty(uname)){
            $("#deletemsg").html("用户姓名不可为空！");
            return;
        }
        if(isEmpty(upwd)){
            $("#deletemsg").html("用户密码不可为空！");
            return;
        }
        $("#deleteForm").submit();
    });
    function isEmpty(str){
        if(str==null || str.trim()==""){
            return true;
        }
        return false;
    }
</script>
</html>
